/**
 *
 */
package com.uuah.server.bootstrap.felix;

import java.util.Dictionary;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.service.cm.ConfigurationException;
import org.osgi.service.cm.ManagedService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.uuah.server.UuahServer;

/**
 * @author jonny
 *
 */
public class UuahServerFelix implements BundleActivator, ManagedService,
		Runnable {
	private static Logger logger = LoggerFactory
			.getLogger(UuahServerFelix.class);
	private UuahServer uuahServer;

	@Override
	public void start(BundleContext arg0) throws Exception {
		logger.debug("Start Uuah Server bundle by Felix");
		uuahServer = new UuahServer();
		uuahServer.start(false);
	}

	@Override
	public void stop(BundleContext arg0) throws Exception {
		logger.debug("Stop Uuah Server Bundle by Felix");
		uuahServer.shutdown();
	}

	@Override
	public void updated(Dictionary arg0) throws ConfigurationException {
		logger.debug("update Uuah Server Bundle by Felix");
	}

	@Override
	public void run() {
		logger.debug("Run Uuah Server Bundle by Felix");
	}

}
